package com.suneast.suneaststore.modules.homepage.adapter;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.suneast.suneaststore.R;
import com.suneast.suneaststore.bean.homepage.ProductStoreCategoryItemBean;

import java.util.ArrayList;

/**
 * Created by zestz on 2018/3/7.
 */

public class CategoryAdapter extends BaseQuickAdapter<ProductStoreCategoryItemBean, BaseViewHolder> {

    public CategoryAdapter(int layoutResId, ArrayList<ProductStoreCategoryItemBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, ProductStoreCategoryItemBean item) {
        Glide.with(helper.itemView.getContext()).load(item.getImgUrl()).into(
                (ImageView) helper.getView(R.id.circle_img_product));
        helper.setText(R.id.tv_category_name,item.getName());
    }

}
